package main

import (
	"net"
	"net/rpc"
)

type HelloService struct {}

func (s *HelloService)Hello(request string, reply *string) error {
	*reply = "Hello" + request
	return nil
}

func main() {
	// 示例话一个service
	listener1, _ := net.Listen("tcp", ":12345")
	// 注册
	_ = rpc.RegisterName("HelloService", &HelloService{})
	// 启动服务
	connet, _ := listener1.Accept()
	rpc.ServeConn(connet)

}
